#!/usr/bin/env python
# Copyright (C) 2007 by Xyhthyx <xyhthyx@gmail.com>

# This file is part of Parcelle.

# Parcelle is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.

# Parcelle is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import os
import gtk
import sys

# Version check
if gtk.pygtk_version < (2, 10, 0):
	print 'Parcelle requires PyGTK 2.10 or greater.'
	sys.exit(1)

# Change working directory to Parcelle's installed path
basedir = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, basedir)
os.chdir(basedir)
del basedir

try:
	from widgets.parcelle import ParcelleWidgets
	from control.parcelle import Parcelle
except ImportError:
	print 'Error importing essential packages.'
	print 'Please reinstall Parcelle.'
	sys.exit(1)

# Start the program
control = Parcelle(ParcelleWidgets())
gtk.main()
